package com.core;
import java.io.*;

public interface Constant extends Serializable, Comparable {

    /**
     * Gets the actual value of the constant.
     *
     * @return the value of the constant
     */
    public String getValue();

    /**
     * Creates a string representation of the constant value.
     *
     * @return the value as a string
     */
    public String toString();

    /**
     * Compares two Constant objects for equality. If the object
     * passed to this method is of type String then a conversion of the String
     * value into a constant of the same type as the current constant is done.
     * If it succeedes then a comparision between the two constants is done.
     *
     * @param obj the object to compare
     * @return true if equal, false otherwise
     */
    public boolean equals(Object obj);

    /**
     * Calculates the hash code for this constant by returning the hash code for its value
     * @return the hash code
     */
    public int hashCode();

    /**
     * Compares to Constants on the toString method.
     * @param obj other Constants to compare with
     * @return negative integer, zero or positive integer if the supplied object is less than, equal or greater than this Constant
     */
    public int compareTo(Object obj);
}
